package org.duiduo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.duiduo.pojo.TbUser;
import org.duiduo.service.TbUserService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * (TbUser)表控制层
 *
 * @author liangze
 * @date 2021-07-30 15:20:36
 * @since
 */
@CrossOrigin
@RestController
@RequestMapping("/user")
public class TbUserController {

    @Reference
    private TbUserService tbUserService;

    @GetMapping("/getList")
    public List<TbUser> getList() {
        return tbUserService.getList();
    }

    @PostMapping("/addUser")
    public void addUser(@RequestBody TbUser user) {
        tbUserService.insert(user);
    }
}
